package com.zb.daoimpl;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.zb.dao.BaseDao;
import com.zb.dao.MsiDao;
import com.zb.entity.Msi;

public class MsiDaoImpl implements MsiDao{
	private BaseDao db=new BaseDao();
	public List<Msi> getMsiList() {
		List<Msi> list=new ArrayList<Msi>();
		String sql="select*from msi";
		ResultSet rs=db.query(sql);
		try {
			while(rs.next()) {
				Msi m=new Msi();
				m.setId(rs.getInt(1));
				m.setTypeName(rs.getString(2));
				list.add(m);
				return list;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally {
			db.close();
		}
		return null;
	}

}
